package com.liu.sx.dao;

import com.liu.sx.entity.Driver;
import com.liu.sx.entity.Voltage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface VoltageDao extends JpaRepository<Voltage,String> , JpaSpecificationExecutor<Voltage> {


     @Query(value = "select t from Voltage  t where t.address like concat('%',:query,'%') ")
     Page<Voltage> findAll(@Param("query") String query, Pageable pageable);

    List<Voltage> findByAddress(String adress);
}
